<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>混合方式创建对象</title>
	</head>
	<body>
		<script>
			function Student (id,name) {
				this.id=id;
				this.name=name;
				this.sayHi=function(){console.log("hi")};
			}
			Student.prototype.introduce=function() {
				console.log("Good morning")
			}
			
			var s1= new Student(1,'Mary');
			var s2= new Student(1,'Jack');
			
			console.log(s1.sayHi==s2.sayHi);  //false
			console.log(s1.introduce==s2.introduce);  //true
		</script>
	</body>
</html>
